<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css"/>
		<script>
		function changeBoxType()
		{
			var type = $(".changeType option:selected").val();
			
			if(type==2)
			{
				$(".type2").show();
			}
			else
			{
				$(".type2").hide();
			}
			
		}
		</script>
	</head>
	<body>
	<div class="am-g">
		 {include file='../Common/hy_header.html'}
		<div class="am-tabs am-margin" data-am-tabs="{ noSwipe: 1}">
    <ul class="am-tabs-nav am-nav am-nav-tabs">
      <li class="am-active"><a hidefocus="true" href="#tab1">弹框详情</a></li>
      
</ul>

    <form class="am-tabs-bd am-form hy-js-form" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
      
      <div class="am-tab-panel am-fade am-active am-in" id="tab1">
      	<div class="am-form-group">
          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              弹框文字
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input type="text" name="name" value="{$ad.name}" class="am-input-sm">
            </div>
          </div>
			</div>
    	
		<div class="am-form-group">
          
		   <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              弹框图片
            </div>
            <div class="am-u-sm-4">
              <input type="text" name="pic" class="am-input-sm" value="{$ad.pic}">
             
            </div>
            <div class="am-u-sm-1">
            	 <img id="hy-thumb" style="height: 30px;" {if $ad.pic}src="/ws{$ad.pic}"{else} src="{$_C.hy_path}/ws/images/logo2.png" {/if}>
            	</div>
             <div class="am-u-sm-4 am-u-end">
             	<button class="am-btn am-btn-primary am-btn-xs hy-js-uploadimg" >上传</button>
          </div>
             </div>
			</div>
    	
		<div class="am-form-group">
          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
             弹框描述
            </div>
            <div class="am-u-sm-4 am-u-end">
               <textarea rows="3" name="content" placeholder="供后台管理使用">{$ad.content}</textarea>
            </div>
          </div>

          </div>
    	
		<div class="am-form-group">
		  <div  class="am-g am-margin-top hy-js-menupanel ">
							<div class="am-u-sm-2 am-text-right">弹框类型</div>
							<div class="am-u-sm-4 am-u-end">
								<select name="type"   onchange="changeBoxType()" class="changeType" disabled=disabled>
									{if $group.type !=1}
									<option {if $ad.type==2} selected="selected" {/if} value="2">奖项框</option>
									<option {if $ad.type==3} selected="selected" {/if} value="3">谢谢参与框</option>
									{/if}
									{if $group.type !=2}
									<option {if $ad.type==1} selected="selected" {/if} value="1">个人信息框</option>
									{/if}
								</select>
								<input type="hidden" name="type" value="{$ad.type|default:2}">
							</div>
						</div>
			</div>
				
								
     		<div class="am-form-group">
						<div  class="am-g am-margin-top hy-js-menupanel ">
							<div class="am-u-sm-2 am-text-right">是否外链</div>
							<div class="am-u-sm-4 am-u-end">
							<div class="am-btn-group" data-am-button="">
								<label class="am-btn am-btn-default am-btn-xs  {if $ad.is_extend_links eq 1} am-active{else}{/if}">
									<input type="radio" name="is_extend_links" value="1" {if $ad.is_extend_links eq 1} checked="checked" {else}{/if}   id="is_extend_links1"> 是
								</label>
								<label class="am-btn am-btn-default am-btn-xs  {if $ad.is_extend_links eq 0}am-active{else}{/if}">
									<input type="radio" name="is_extend_links" {if $ad.is_extend_links eq 0} checked="checked" {else}{/if} value="0" id="is_extend_links2">否
								</label>
							</div>
						</div>
					</div>
    		</div>
		<div class="am-form-group">
		<div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
             外链地址
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input name="url" value="{$ad.url}" type="text" class="am-input-sm">
            </div>
            
          </div>
		  
		  </div>
    	
		<div class="am-form-group type2">
          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              奖项优先级
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input type="text" name="prize" value="{$ad.prize}" class="am-input-sm"  placeholder="1表示1等奖，2表示2等级。谢谢参与和其他请置0">
            </div>
          </div>
		  </div>
    	
		<div class="am-form-group type2">
		  <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              中奖概率
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input type="text" name="pby" value="{$ad.pby}" class="am-input-sm"  placeholder="请输入正整数">
            </div>
          </div>
		  </div>
    	
		<div class="am-form-group type2">
		   <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              限制触发人数
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input type="text" name="limitnums" value="{$ad.limitnums}" class="am-input-sm"  placeholder="请输入正整数">
            </div>
          </div>
		  </div>
		<div class="am-form-group type2">
		   <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
             	 绑定红包
            </div>
            <div class="am-u-sm-4 am-u-end">
              <select name="hongbao_id">
				<option value="0">暂不绑定</option>
				{foreach from=$lucky item=item }
				<option {if $item.id eq $ad.hongbao_id  } selected="selected" {/if} value="{$item.id}">{$item.title}</option>
				{/foreach}
			 </select>
            </div>
				<div class="am-u-sm-3 " style="float: left;">若绑定红包，则外链失效</div>
          </div>
		  </div>
	
  
          


        
    
       <input type="hidden" name="group_id" value="{$group_id}" />
 		<input type="hidden" name="id" value="{$id}" />
		 </div>
    </form>
    <div class="am-margin">
    <button type="button" class="am-btn am-btn-primary hy-js-submit am-btn-xs">提交保存</button>
    
  </div>
  </div>
	</div>	
	 
	  {include file='../Common/hy_footer.html'}
	<script type="text/javascript" src="{$_C.hy_path}js/editor/kindeditor.js"></script>
	<script type="text/javascript">
	    hy_uploadimg('/ad',{},function(result){
	    	if(typeof(result[0])!='undefined')
	    	{
	        	$('#hy-thumb').attr('src',"/ws"+result[0]);
	        	$('input[name=pic]').val(result[0]).focus();
	       }
	    })
	    
	    hy_submit('index.php?g=admin&m=chat&a={$action}','',function(result){
			showMsg(result.content,result.error);
			parent.$('#addadpos_{$group_id}').attr('src', parent.$('#addadpos_{$group_id}').attr('src'));
		});
		changeBoxType('{$ad.type}');
	</script>
	</body>
</html>
